import React, { Component } from 'react';
import { StyleSheet, View, Dimensions, Text, Image, TextInput, TouchableOpacity } from "react-native";
import { style } from '../../../../theme/style';
import { ParentBox } from './ParentBox';
import navigationSeevice from '../../../../components/navigation/navigationSeevice';

const ScreenWidth = Dimensions.get('window').width;
const scale = ScreenWidth / 375;

export class AttachmentCpt extends ParentBox {
	constructor(props) {
		super(props);
	}

	_content = () => {
		let { finalFileId, finalFileName } = this.props;
		return (
			<View style={styles.TextArea}>
				<Text style={styles.title}>附件:</Text>
				<View style={styles.imgBox}>
					{finalFileId ?
						<Text style={styles.find} onPress={() => {
							navigationSeevice.navigate('ContractPdfPage', { finalFileId, title: '附件信息' });
						}}>{finalFileName || '查看附件'}</Text> : <Text style={styles.none}>无</Text>
					}
				</View>
			</View>
		)
	}
}

const styles = StyleSheet.create({
	TextArea: {
		flexDirection: 'row',
		alignItems: 'center'
	},
	title: {
		fontSize: 12 * scale,
		marginVertical: 10 * scale
	},
	input: {
		borderRadius: 8 * scale,
		borderColor: '#D8D8D8',
		borderWidth: 1,
		height: 46 * scale,
		paddingHorizontal: 5 * scale,
		marginBottom: 10 * scale,
	},
	imgBox: {
		flexDirection: 'row',
		paddingLeft: 10 * scale,
		flexWrap: 'wrap'
	},
	imagseImg: {
		width: 40 * scale,
		height: 40 * scale,
		//marginVertical: 10 * scale,
		marginHorizontal: 10 * scale,
		marginBottom: 15 * scale
	},
	find: {
		fontSize: 12 * scale,
		color: style.color.themeColor,
		paddingLeft: 10 * scale
	},
	none: {
		fontSize: 12 * scale,
		paddingLeft: 10 * scale
	}
})